export const namespace = "adminSystemClass";
import { Image } from "antd";
export const calcColumns = (params) => {
  const { operate } = params;
  const columns = [
    {
      title: "ID",
      hidden: process.env.UMI_ENV == "prod" ? true : false,
      width: 180,
      dataIndex: "id",
      hideInSearch: true,
    },
    {
      title: "模版名称",
      dataIndex: "templateName",
    },
  ];

  columns.push(operate);
  return columns;
};
export const calcColumns2 = (params) => {
  const { operate } = params;
  const columns = [
    {
      title: "排序",
      dataIndex: "sort",
      width: 100,
      className: "drag-visible",
      hideInSearch: true,
    },
    {
      title: "步骤名称",
      dataIndex: "linkName",
    },
    {
      title: "步骤图标",
      dataIndex: "linkPicUrl",
      render: (text, record) => {
        return <Image width={40} height={40} src={record.linkPicUrl}></Image>;
      },
    },
    {
      title: "跳转类型",
      dataIndex: "clickJump",
      render: (text, record) => {
        return text == 1 ? "无跳转" : text == 2 ? "链接" : "考试";
      },
    },
    {
      title: "链接地址",
      dataIndex: "pointLink",
      render: (text, record) => {
        return record.clickJump == 2 ? record.pointLink : "";
      },
    },
    {
      title: "试卷名称",
      dataIndex: "examName",
      render: (text, record) => {
        return record.clickJump == 3 ? record.examName : "";
      },
    },
  ];

  columns.push(operate);
  return columns;
};
